import 'package:myapp/dio/dio_client.dart';
import 'package:myapp/dio/model/api_response.dart';
import 'package:myapp/dio/model/token_data.dart';

class Auth {
  static Future<TokenData> loginApi(String account, String password) async {
    Map<String, dynamic> payload = {"account": account, 'password': password};
    //  await dioClient.post("/auth/login", payload);
    var jsonData =
        ApiResponse.fromJson(await dioClient.post("/auth/login", payload)).data;
    return TokenData.fromJson(jsonData);
  }
}
